package com.zzy.test;

import com.zzy.dao.UserDao;
import com.zzy.model.User;
import com.zzy.service.UserService;
import org.junit.*;

import javax.management.OperationsException;

public class UserServiceTestJUnit {
    private UserService userService;


    @Before
    public void setUp(){
        userService = new UserService(new UserDao());
    }


    @Test
    public void testQueryuserCount() throws  Exception{
        try {
             userService .queryCount();
        }catch (Exception e){
            Assert.assertTrue( e instanceof OperationsException);
        }
    }

    @Test
    public void testInsertUser() throws  Exception{
        try {
            userService.insertUser(new User());
        }catch (Exception e){
            Assert.assertTrue( e instanceof OperationsException);
        }
    }
}
